﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Vote.aspx.cs" Inherits="Vote" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <title></title>
    <style type="text/css">
        .style1
        {
            height: 39px;
        }
    </style>
    </head>
<body>


    <form id="form1" runat="server">
    Enter your name:
<asp:TextBox id="txt1" runat="server" />

    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

<p><asp:Label id="lbl1" runat="server" /></p>
    <div>
    
        <table style="width: 100%; height: 162px;">
            <tr>
                <td rowspan="2">
                    <asp:TextBox ID="AskTextBox" runat="server" Height="71px" Width="135px"></asp:TextBox>
                    <asp:Button ID="Ask" runat="server" onclick="Ask_Click" Text="Ask" />
                    <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
                </td>
                <td rowspan="2">
                    <asp:TextBox ID="TextBox1" runat="server" Height="71px" Width="134px"></asp:TextBox>
                    
                    <asp:Button ID="Answer" runat="server" onclick="Answer_Click" Text="Answer" />
                    
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    <br />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                     
                        CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource1" 
                        ForeColor="#333333" GridLines="None">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="Question" HeaderText="Question" 
                                SortExpression="Question" />
                            <asp:BoundField DataField="username" HeaderText="username" 
                                SortExpression="username" />
                            <asp:BoundField DataField="ID" HeaderText="ID" 
                                SortExpression="ID" InsertVisible="False" ReadOnly="True" />
                            <asp:ButtonField ButtonType="Button" CommandName="SELECT" Text="ViewAnswer" />
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                       
                        
                        
                     
                    </asp:GridView>
<%--<asp:Button ID="btn" runat="server"  />--%>
                </td>
                <td>
                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" DataSourceID="SqlDataSource2" 
                        ForeColor="#333333" GridLines="None" 
                        onselectedindexchanged="GridView2_SelectedIndexChanged" 
                        DataKeyNames="Answer_ID">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    
                                    <asp:Button ID="Button1" runat="server" Text="Button" CommandName="SELECT" 
                                        onclick="Button1_Click" />

                                    
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Answer" HeaderText="Answer" 
                                SortExpression="Answer" />
                            <asp:BoundField DataField="Username" HeaderText="Username" 
                                SortExpression="Username" />
                            <asp:BoundField DataField="Answer_ID" HeaderText="Answer_ID" 
                                InsertVisible="False" ReadOnly="True" SortExpression="Answer_ID" />
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                      <asp:Button ID="ahooo" runat="server" onclick="Ahoo_click" Text="ahoooo" 
            Visible="false" Height="24px" />
                </td>
                <td style="margin-left: 40px">
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:abdalla_VoteConnectionString %>" 
                        
                        SelectCommand="SELECT [Answer],[Username],[Answer_ID] FROM [ANS_Table_Abdo] WHERE ([ID] = @ID)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="GridView1" Name="ID" 
                                PropertyName="SelectedValue" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:abdalla_VoteConnectionString %>" 
                        SelectCommand="SELECT [Question], [username], [ID] FROM [Que_table_abdo]">
                    </asp:SqlDataSource>
                      
                </td>
            </tr>
        </table>
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      
        
    
    </div>
    
    <p>
        &nbsp;</p>
    
    </form>
</body>
</html>
